<?php
/**
 * 地址验证器
 */

namespace app\common\validate;

class AddressValidate extends CommonBaseValidate
{
    protected $rule = [
            'user_id|用户' => 'require',
    'province_id|省' => 'require',
    'city_id|市' => 'require',
    'area_id|区' => 'require',
    'address|地址' => 'require',
    'status|默认地址' => 'require',

    ];

    protected $message = [
            'user_id.required' => '用户不能为空',
    'province_id.required' => '省不能为空',
    'city_id.required' => '市不能为空',
    'area_id.required' => '区不能为空',
    'address.required' => '地址不能为空',
    'status.required' => '默认地址不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['user_id', 'province_id', 'city_id', 'area_id', 'address', 'lng', 'status', ],
        'admin_edit'    => ['id', 'user_id', 'province_id', 'city_id', 'area_id', 'address', 'lng', 'status', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['user_id', 'province_id', 'city_id', 'area_id', 'address', 'lng', 'status', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'user_id', 'province_id', 'city_id', 'area_id', 'address', 'lng', 'status', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
